# -*- coding: utf-8 -*-
"""
基础复合组件类 - TgBaseComposite
所有TG复合组件的基类
"""
from .widget import TgBaseWidget


class TgBaseComposite(TgBaseWidget):
    """所有TG复合组件的基类"""
    
    def __init__(self, parent=None):
        super().__init__(parent)
        self._component_parts = {}
    
    def add_component_part(self, name, component):
        """添加组件部分"""
        self._component_parts[name] = component
    
    def get_component_part(self, name):
        """获取组件部分"""
        return self._component_parts.get(name)
    
    def get_component_parts(self):
        """获取所有组件部分"""
        return self._component_parts.copy() 